<?php

$wootext   = $_POST['wootext'];

$wootext   = stripslashes($wootext);


$filename = 'test.txt';
$somecontent = "Add this to the file\n";
$somecontent2 = "Add this to the file2\n";

if (is_writable($filename)) {


    if (!$handle = fopen($filename, 'wb')) {
         echo "Cannot open file ($filename)";
         exit;
    }


    if (fwrite($handle, $wootext) === FALSE) {
        echo "Cannot write to file ($filename)";
        exit;
    }

    echo "Success, wrote ($wootext) to file ($filename)";

    fclose($handle);

} else {
    echo "The file $filename is not writable, or doesn't exist";
}
?>
